<?php
namespace app\back\controller;
use think\Controller;
use think\Db;
use think\Request;
/*权限列表*/
class Node extends Common{
    /**权限展示页面**/
    public function node(){
       // $re=Db::name('role')->paginate(3,false);
         return  $this->fetch('Node/admin-permission');

    }
    //权限节点展示页面
    public function node_add(){
        //echo 11;
       return  $this->fetch('Node/admin-permission-add');
    }
    //添加权限
    public function nodeTo(){
     $data=input('post.');
    $rs= Db::name('rbac_node')->insert($data);
    if($rs){
        return json(['state'=>'1','msg'=>'操作成功']);
     }else{
        return json(['state'=>'0','msg'=>'操作失败再试试']);
    }

    }
    //权限展示
    public function nodeList(){
        $nodeList=db('think_node')->select();
        return view('node',array('node'=>$nodeList));

    }
}